package cn.byau.se01.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entity.Student;
import service.StudentService;

/**
 * Servlet implementation class StudentServlet
 */
@WebServlet("/InsertServlet")
public class InsertServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
     public static  final double PI=3.1415926;
       
    

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String no=request.getParameter("no");
		String name=request.getParameter("name");
		
		
		Student s1 = new Student("123", "li", 20, "1999-01-10");
		
		StudentService service=new StudentService();
		boolean flag=service.insertStudent(s1);
		System.out.println(flag);
		if(flag) {
			
		}else {
			
		}
		
		//StudentDAO dao=new StudentDAO();
		//Student s2=dao.getStudent();
		
		
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
